extends Card


func play_on_release(card_view: CardView) -> void:
	var player = card_view.get_tree().get_first_node_in_group("player")
	player.play_animation("attack")
	var tween := card_view.create_tween()
	CardManager.round_data.cant_attack = true
	CardManager.avail_point += self.point
	Events.card_table_point_update.emit()
	if Globals.player_state.cant_draw_card == 0:
		tween.set_loops(self.draw_card)
		tween.tween_callback(func(): Events.card_table_drad_one_card.emit())
		tween.tween_interval(0.21)
	else:
		tween.tween_interval(0.1)
	await tween.finished
	player.play_animation("default")
	card_view.play_on_release_signal_finish.emit()


func get_desc() -> String:
	if desc_lab == "":
		return ""
	var text = desc_lab % [self.point, self.draw_card]
	return text


func init_from_csv(introduce):
	super.init_from_csv(introduce)
	self.draw_card = int(introduce[6])
	self.point = int(introduce[5])
